package com.example.hz52.app.gen;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.hz52.app.Sqlentity.Conver;
import com.example.hz52.app.Sqlentity.User;
import com.example.hz52.app.Sqlentity.Account;
import com.example.hz52.app.Sqlentity.Music;
import com.example.hz52.app.Sqlentity.Chat;
import com.example.hz52.app.Sqlentity.Gift;

import com.example.hz52.app.gen.ConverDao;
import com.example.hz52.app.gen.UserDao;
import com.example.hz52.app.gen.AccountDao;
import com.example.hz52.app.gen.MusicDao;
import com.example.hz52.app.gen.ChatDao;
import com.example.hz52.app.gen.GiftDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig converDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig accountDaoConfig;
    private final DaoConfig musicDaoConfig;
    private final DaoConfig chatDaoConfig;
    private final DaoConfig giftDaoConfig;

    private final ConverDao converDao;
    private final UserDao userDao;
    private final AccountDao accountDao;
    private final MusicDao musicDao;
    private final ChatDao chatDao;
    private final GiftDao giftDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        converDaoConfig = daoConfigMap.get(ConverDao.class).clone();
        converDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        accountDaoConfig = daoConfigMap.get(AccountDao.class).clone();
        accountDaoConfig.initIdentityScope(type);

        musicDaoConfig = daoConfigMap.get(MusicDao.class).clone();
        musicDaoConfig.initIdentityScope(type);

        chatDaoConfig = daoConfigMap.get(ChatDao.class).clone();
        chatDaoConfig.initIdentityScope(type);

        giftDaoConfig = daoConfigMap.get(GiftDao.class).clone();
        giftDaoConfig.initIdentityScope(type);

        converDao = new ConverDao(converDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        accountDao = new AccountDao(accountDaoConfig, this);
        musicDao = new MusicDao(musicDaoConfig, this);
        chatDao = new ChatDao(chatDaoConfig, this);
        giftDao = new GiftDao(giftDaoConfig, this);

        registerDao(Conver.class, converDao);
        registerDao(User.class, userDao);
        registerDao(Account.class, accountDao);
        registerDao(Music.class, musicDao);
        registerDao(Chat.class, chatDao);
        registerDao(Gift.class, giftDao);
    }
    
    public void clear() {
        converDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        accountDaoConfig.clearIdentityScope();
        musicDaoConfig.clearIdentityScope();
        chatDaoConfig.clearIdentityScope();
        giftDaoConfig.clearIdentityScope();
    }

    public ConverDao getConverDao() {
        return converDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public AccountDao getAccountDao() {
        return accountDao;
    }

    public MusicDao getMusicDao() {
        return musicDao;
    }

    public ChatDao getChatDao() {
        return chatDao;
    }

    public GiftDao getGiftDao() {
        return giftDao;
    }

}
